home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2001 November / macformat-109.iso / Shareware / Utilities / CreaText 1.3.2ƒ.sea / CreaText 1.3.2ƒ / CreaText Help / docs / control < prev    next >
Encoding:
Text File  |  2001-08-27  |  3.9 KB  |  157 lines  |  [TEXT/JAZZ]

  1. <HTML>
  2.  
  3.     <HEAD><TITLE>The Color chooser</TITLE></HEAD>
  4.     <META name="Description" content="This page shows how to control CreaText from the outside">
  5.     <META name="Keywords" content="AppleEvents, AppleScript, control">
  6.     <BODY bgcolor="white">
  7.  
  8. <FONT face="Charcoal" size="6">
  9. Controlling CreaText
  10. </FONT>
  11. <P></P>
  12.  
  13.  
  14.  
  15.  
  16. <BR> <BR>
  17. You can control CreaText from other applications using AppleEvents and AppleScript.
  18. <BR> <BR>
  19. <FONT color="#330099" face="Chicago" size="3">
  20. AppleEvents
  21. </FONT><BR> <BR>
  22.  
  23.  
  24. If you are programming applications, you may find it useful to send an AppleEvent to CreaText. CreaText supports the following functions using AppleEvents:<BR>
  25.  
  26. <TABLE border="0" width="400">
  27. <!-- Row: 0 -->
  28. <TR>
  29.  <!--   Row: 0, Column: 0 -->
  30.  <TD colspan="2" rowspan="1">
  31. <BR><B>Launch CreaText</B>
  32.  </TD>
  33. </TR>
  34. <!-- Row: 1 -->
  35. <TR>
  36.  <!--   Row: 1, Column: 0 -->
  37.  <TD colspan="1" rowspan="1">
  38. <B>Description</B>:
  39.  </TD>
  40.  <!--   Row: 1, Column: 1 -->
  41.  <TD colspan="1" rowspan="1">
  42. This is the commonf AppleEvent to launch CreaText.
  43.  </TD>
  44. </TR>
  45. <!-- Row: 2 -->
  46. <TR>
  47.  <!--   Row: 2, Column: 0 -->
  48.  <TD colspan="1" rowspan="1">
  49. <B>Parameters</B>:
  50.  </TD>
  51.  <!--   Row: 2, Column: 1 -->
  52.  <TD colspan="1" rowspan="1">
  53. EventClass is "aevt", event id is "oapp"
  54.  </TD>
  55. </TR>
  56. <!-- Row: 3 -->
  57. <TR>
  58.  <!--   Row: 3, Column: 0 -->
  59.  <TD colspan="2" rowspan="1">
  60. <BR><B>Open a file with CreaText</B>
  61.  </TD>
  62. </TR>
  63. <!-- Row: 4 -->
  64. <TR>
  65.  <!--   Row: 4, Column: 0 -->
  66.  <TD colspan="1" rowspan="1">
  67. <B>Description</B>:
  68.  </TD>
  69.  <!--   Row: 4, Column: 1 -->
  70.  <TD colspan="1" rowspan="1">
  71. This is the common AppleEvent to open a file with CreaText
  72.  </TD>
  73. </TR>
  74. <!-- Row: 5 -->
  75. <TR>
  76.  <!--   Row: 5, Column: 0 -->
  77.  <TD colspan="1" rowspan="1">
  78. <B>Parameters</B>:
  79.  </TD>
  80.  <!--   Row: 5, Column: 1 -->
  81.  <TD colspan="1" rowspan="1">
  82. Event class is "aevt", event id is "odoc"
  83.  </TD>
  84. </TR>
  85.  
  86.  
  87. <!-- Row: 3 -->
  88. <TR>
  89.  <!--   Row: 3, Column: 0 -->
  90.  <TD colspan="2" rowspan="1"><BR>
  91. <B>Open a file with CreaText and go to line number</B>
  92.  </TD>
  93. </TR>
  94. <!-- Row: 4 -->
  95. <TR>
  96.  <!--   Row: 4, Column: 0 -->
  97.  <TD colspan="1" rowspan="1">
  98. <B>Description</B>:
  99.  </TD>
  100.  <!--   Row: 4, Column: 1 -->
  101.  <TD colspan="1" rowspan="1">
  102. This is a nice AppleEvent you can use to open a file with CreaText and determine to which line number CreaText should jump
  103.  </TD>
  104. </TR>
  105. <!-- Row: 5 -->
  106. <TR>
  107.  <!--   Row: 5, Column: 0 -->
  108.  <TD colspan="1" rowspan="1">
  109. <B>Parameters</B>:
  110.  </TD>
  111.  <!--   Row: 5, Column: 1 -->
  112.  <TD colspan="1" rowspan="1">
  113. Event class is "JAZZ", event id is "Opnf". You have to create two DescListParams. The first should have the parameter "file" and contain as information the file to open. The second one should have as parameter "line" and contain as information an integer, the line number.
  114.  </TD>
  115. </TR>
  116.  
  117. </TABLE>
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124. <FONT color="#330099" face="Chicago" size="3">
  125. AppleScript
  126. </FONT><BR> <BR>
  127.  
  128. You can use AppleScript to write scripts that command CreaText to do tasks. You can use the Script Editor to get an overview of all commands CreaText supports.
  129.  
  130.  
  131. <BR>
  132. Although there are no entries displayed in the required suite, CreaText supports the run, open, quit and print commands.<BR>
  133. Additionally, CreaText has an AppleScript menu. You can place scripts (compiled scripts as well as text files) into the "AppleScript" folder inside the CreaText folder. When you then launch CreaText, they will be displayed in the AppleScript menu and you can select them. Take a look at the sample scripts in that folder.
  134.  
  135.  
  136.  
  137.  
  138. <!-- Back-Link-->
  139. <P align="center">
  140. <A href="../index">[Table of Contents]</A>
  141. </P>
  142. <P align="center">
  143. <A href="intro">[Intro]</A> 
  144. <A href="new">[New document]</A> 
  145. <A href="menu">[Menus]</A> 
  146. <A href="prefs">[Preferences]</A> 
  147. <A href="work">[Working with CT]</A> 
  148. <A href="cc">[Color chooser]</A> 
  149. <A href="context">[Contextual menu]</A> 
  150. <A href="extend">[Extending CT]</A> 
  151. <A href="control">[Controlling CT]</A> 
  152. </P>
  153.  
  154. <!-- Think different. -->
  155.  
  156.      </BODY>
  157. </HTML>